﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls.WebParts;
using System.Data;
public partial class Manage_menu : AdminPageBase
{
    protected DataTable dtModuleGroup;
    protected DataTable UserPermisionTb;
    protected int GroupId;
    protected string GroupName;
    protected string MenuName;
    protected string PageUrl;
    protected int SMenuId;
    protected void Page_Load(object sender, EventArgs e)
    {
       CheckAdmin();
        if (!IsPostBack)
        {
            dtModuleGroup=BindModule(0);
            GetPermisions();
        }
    }
    protected void CheckAdmin()
    {
        if (AdminSessionHelper.UserDetails== null)
        {
            JsHelper.TopAlertRedirect("请先登录", "login.aspx", this.Page);
            Response.End();
        }
    }
  
    protected DataTable BindModule(int parentId)
    {
        string strWhere = " ParentId=" + parentId+" AND IsValid=1";
        return jtDataAccess.GetList("Menu", strWhere, "SortId").Tables[0];
    }
    protected void GetPermisions()
    {
        int id =int.Parse(AdminSessionHelper.UserDetails["UserId"].ToString());
        UserPermisionTb = jtDataAccess.GetUserPermision(id);
    }
    
}